const Mock = require('mockjs')
const random = Mock.Random

module.exports = function (app) {
    app.get('/api/user', function(req, res) {
        data = Mock.mock({
            id: 1,
            name: "王哈哈",
            status: 1
        })

        res.json(data)
    })

    app.get('/api/patients', function(req, res) {
        data = Mock.mock({
            'data|1-10': [{
                'id|+1': 1,
                'name': '@cname',
                'identity_code': '@integer(100000,999999)******@integer(1000,9999)',
                'cord_code': '@integer(10000000, 99999999)',
                'hospital': '大连大学附属中医院'
            }]
        })
        res.json(data)
    })
}